#include<linux/module.h>
#include<linux/sched.h>
#include<linux/pid.h>
#include<linux/pid_namespace.h>
MODULE_LICENSE("GPL");
static int __init ns_of_pid_init(void)
{
	printk("into ns_of_pid_init.\n");
	struct pid *kpid=find_get_pid(current->pid);
	printk("the level of the pid is:%d\n",kpid->level);

	printk("the pid of the pid is:%d\n",kpid->numbers[kpid->level].nr);
	struct pid_namespace *pid_ns=ns_of_pid(kpid);
	printk("the level of the pid_namepsace is:%d\n",pid_ns->level);
	
	printk("the last_pid of the pid_namespace is:%d\n",pid_ns->last_pid);
	printk("the current pid is:%d\n",current->pid);
	printk("the current tgid is:%d\n",current->tgid);
	printk("out ns_of_pid_init.\n");
	return 0;
}
static void __exit ns_of_pid_exit(void)
{
	printk("Goodbye ns_of_pid\n");
}
module_init(ns_of_pid_init);
module_exit(ns_of_pid_exit);
